pub struct Solution;

impl Solution {
    pub fn check_possibility(nums: Vec<i32>) -> bool {
        let mut previous = i32::MIN;
        let mut count = 0;
        for num in nums {
            if num >= previous {
                previous = num;
            } else {
                count += 1;
            }
        }
        count <= 1
    }
}

#[test]
pub fn test() {
    assert_eq!(Solution::check_possibility(vec![4, 2, 3]), true);
}